﻿using System;
using System.ServiceModel;
using Cubicle.Core.DataContracts;

namespace Cubicle.Core.Interfaces
{
    [ServiceContract(
        SessionMode = SessionMode.Allowed,
        Namespace = "http://www.cubicle.co.uk/",
        Name = "IRepository")]
    public interface IRepository
    {
        event EventHandler<RepoEventArgs> SetEvent;
        event EventHandler<RepoEventArgs> GetEvent;
        event EventHandler<RepoEventArgs> RemoveEvent;

        [OperationContract]
        void Clear();

        [OperationContract]
        string[] List();

        [OperationContract]
        string Rename(string handle, string newKey);

        IRObject Remove(string handle);

        [OperationContract]
        bool DisposeRemove(string handle);

        [OperationContract]
        bool Has(string handle);

        [OperationContract]
        string Set(string key, object item);

        [OperationContract]
        object Get(string handle);

        IRObject GetRObject(string handle);

    }
}
